
<#assign cache=JspTaglibs["/WEB-INF/tld/oscache.tld"] /> 

<#include "/WEB-INF/template/mp/title_brand.ftl" />

<link rel="stylesheet" type="text/css" href="${base}/mp/css/top.css" media="all" />
<link rel="stylesheet" type="text/css" href="${base}/mp/css/style_info.css" />
<script type="text/javascript" src="${base}/mp/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${base}/mp/js/jquery.validate.js" charset="iso-8859-1"></script>
<script type="text/javascript" src="${base}/mp/js/jquery.validate.min.js" charset="iso-8859-1"></script>
<script type="text/javascript" src="${base}/mp/js/brand.js"></script>
<script type="text/javascript" src="${base}/mp/js/jquery.raty.min.js"></script>
<script type="text/javascript" src="${base}/js/img_onerror.js"></script>

</head>
<body>

<#include "/WEB-INF/template/mp/menu_bar.ftl" />

<div id="wrap">

<#include "/WEB-INF/template/mp/header_bar_brand.ftl" />
  
  <#if !brand??>

      <div style="padding:100px 10px 100px 100px; font-size:30px;">
      	该品牌已被删除或不存在！
      </div>
      
  <#else>
      
  <div class="center_content">
    <div class="left_content">
      <div class="title">
      	<span class="title_icon">
      	${(brand.name)!'未命名'}
      	</span>
      </div>
      
<@cache.cache key="brand.desc.${(brand.id)!'0'}" time=1> 
      
      <div class="feat_prod_box_details">
    
        <p class="details"> 
          <div class="right">
	          <img width="100px" height="50px"
		          src="${(brand.logoAbsolutePath)!'${base}/images/ppyeah.png'}" 
		          onerror="javascript:nofind(this,'${base}/images/ppyeah.png');" 
		          alt="${(brand.name)!'名牌导航、名牌导购'}" 
		          title="" class="brand_logbrand_log"
		      /> 
		      <p/>
		      <center text-align="center">
		      	<#if (brand.tomlive)?? && (brand.tomlive)!=''>
		      		<a target="_blank" href="${(brand.tomlive)!'javascript:;'}">去官网看看</a>
		      	</#if>
		      </center>
	      </div>
	      
          <div style="width:570px;">
          	${(brand.description)!'暂无描述信息'}
          </div>

		  <div class="clear"></div>
      </div>
      
      
</@cache.cache>
      
      <div class="feat_prod_box_details">

      	<div id="comment_div_sign">&nbsp;</div>
      
      	<#if (brandComments?size)==0>
      		还没有评论，快抢沙发哦…………
      	</#if>
      
        <#list brandComments as comment>
      	<div class="comment_div">
	        <div class="comment_content">
		      	<div class="comment_user">
		      		<div align="center"><img class="user_pic" src="${base}/images/default_user_ico.jpg" /></div>
		      		<div align="center"> ${(comment.creator)!''} </div>
		      		<!--<div align="center">积分：55</div>-->
		      	</div>
		      	<div class="comment_and_reply">
		        	<div class="comment_assess">
			        	<div class="div_overall_appraise">
			        		<span class="overall_appraise">整体评价：
			        		<#if (comment.overallAppraise)==0 >好<#else>不好	</#if>
			        		</span>
			        	</div>
			        	<div class="comment_grade_show">
				        	<#list comment.gradeList as grade>
								<div id="score" class="comment_grade_item">
									<div style="float:left; ">
									<span class="fieldText">${grade.lable}</span>：</div>
									<div id="hint_${comment_index}_${grade_index}"></div>
		    						<div class="clear"></div>
									<div id="star_grade_${comment_index}_${grade_index}"></div>
								</div>
								
								<script type="text/javascript">
				        			$('#star_grade_${comment_index}_${grade_index}').raty({
										path : '${base}/mp/ratyimg/',
										start : ${grade.value},
										hintList : ['很差', '不好', '凑合', '很好', '力挺'],
									    targetKeep: true,
										target: '#hint_${comment_index}_${grade_index}',
									    readOnly : true
									});
								</script>
								
				        	</#list>
			        	</div>
			        	<div class="clear"></div>
		        	</div>
		        	<div class="comment_content">
		        		<#if (comment.title)?? && (comment.title?length>0) >
		        		<div id="comment_title" class="comment_title">
						标题：${(comment.title)!''}
						</div>
						</#if>
						<#if (comment.impression)?? && (comment.impression?length>0)>
		        		<div id="comment_impression" class="comment_impression">
						印象：${(comment.impression)!''}
						</div>
						</#if>
		        		<div id="comment_comtent" class="comment_comtent">
						${(comment.content)!''}
						</div>
		        	</div>
		        	<div>
		        	<div class="reply_affirm left">
		        		这条点评怎么样？
		        		<a id="useful_${(comment.id)!''}"
		        			<#if (Session['use_'+comment.id])?? >
		        				href="javascript:;"
		        			<#else>
		        			  	href="javascript:useful('${base}/comment/useful','${(comment.id)!''}',${(comment.voteWell)!'0'})"
		        			</#if>
		        		><span><img class="flower" src="${base}/images/pink_flower.ico" />有用（<span id="ful_${(comment.id)!''}">${(comment.voteWell)!'0'}</span>）</span></a>
		        		<a id="useless_${(comment.id)!''}" 
		        			<#if (Session["use_"+comment.id])?? >
		        			  	href="javascript:;"
		        			<#else>
		        			  	href="javascript:useless('${base}/comment/useless','${(comment.id)!''}',${(comment.voteBad)!'0'})" 
		        			</#if>>
		        		<span><img class="flower" src="${base}/images/fade_flower.png" />没用（<span id="less_${(comment.id)!''}">${(comment.voteBad)!'0'}</span>）</span></a>
		        	</div>
		        	<div class="right">
						<a href="${base}/comment.html?id=${(comment.id)!'noid'}">查看回应</a>(${(comment.replyCount)!'0'})
					</div>
					</div>
	        	</div>
	      		<div class="clear"></div>
	      	</div>
        </div>
	    </#list>
	    
		<#if (pageBar.getTotalPageCount()>1)>
			
		  <#include "/WEB-INF/template/mp/pagebar.ftl">
			
		</#if>
		
		<!--发布评论的请求地址-->
		<input type="hidden" id="requestUrl" value="${base}/comment/save.ajax" />
		<!--发布评论成功后返回的地址-->
		<input type="hidden" id="seccussRequestUrl" value="${pageBar.getPageUrl(pageBar.getTotalPageCount()+1)}" />
 
 		<form id="comment_form" action="${base}/comment/save.ajax" method="post">
 
 		<input type="hidden" name="comment.brandId" value="${(brand.id)!''}" />
        <div class="comment_input" id="comment_input_div" name="comment_input">
      		<div class="comment_lable_title">发表评论</div>
      		<div class="comment_input_form">
		    	<div class="comment_input_row">
		        	<div class="comment_input_lable"> * 整体评价：</div>
		        	<span class="verror"></span>
		            <div class="commnet_input_right">
		            	<input type="radio" value="0" checked onclick="showField(1)" name="comment.overallAppraise" />好
		                <input type="radio" value="1" onclick="showField(0)" name="comment.overallAppraise" />不好
		        		<span class="verror"></span>
		            </div>
    				<div class="clear"></div>
    				
					<#if (brand.gradeFieldArray)??>
		            	<#assign fields = brand.gradeFieldArray>
		            </#if>
		            	
		            <div id="fields" class="fields">
		            	<#if fields??>
		            	<#list fields as field>
		            	<div id="score" class="comment_grade_input">
							<div style="float:left; "><span class="fieldText">${field}</span>：</div>
							<div id="hint_${field_index}"></div>
    						<div class="clear"></div>
							<div id="star_${field_index}"></div>
						</div>
		            	</#list>
		            	</#if>
		            </div>
		        </div>
    			<div class="clear"></div>
		        <div class="comment_input_row">
		        	<div class="comment_input_lable"><span class="error"> * </span>评价：</div>
		        	<div class="commnet_input_right">
		        		<textarea name="comment.content" class="comment_content_input"></textarea>
		        		<br/>
		        		<span class="verror"></span>
		        	</div>
		        </div>
    			<div class="clear"></div>
		        <div class="comment_input_row">
		        	<div class="comment_input_lable">标题：</div>
		        	<div class="commnet_input_right">
		        		<input type="text" name="comment.title" id="comment.title" class="comment_input_title" size="20" />
		        		<br/>
		        		<span class="verror"></span>
		        	</div>
		        </div>
    			<div class="clear"></div>
		        <div class="comment_input_row">
		        	<div class="comment_input_lable">印象：</div>
		        	<div class="commnet_input_right">
		        		<input type="text" name="comment.impression" id="comment.impression" class="comment_input_impress" size="20" />
		        		<br/>
		        		<span class="verror"></span>
		        	</div>
		        </div>
		        <div class="clear"></div>
		        <div class="comment_input_row">
		        	<div class="comment_input_lable">&nbsp;</div>
		        	<div class="commnet_input_right">
		        		<input type="submit" class="comment_input_commit" value="提交"/>
		        		<input type="reset" onclick="commentReset(this)" class="comment_input_commit" value="取消"/>
		        	</div>
		        </div>
    			<div class="clear"></div>
      		</div>
      	</div>
      </div>    
      
      <input name="comment.grade" id="grade" type="hidden" />
      </from>
      <div class="clear"></div>
      
    </div>
    <!--end of left content-->
    <div class="right_content">
      
      <div class="languages_box">
      	<div class="recommend_div">
	      	<div class="red">推荐指数：</div>
	      	<div class="left recommned_level">
		      	<div id="star_recommend"></div>
		      	<div id="hint_recommend"></div>
		      	<div id="star_message"></div>
	     	</div>
		    <script type="text/javascript">
			     $('#star_recommend').raty({
					path : '${base}/mp/ratyimg/',
					start : ${(brand.level)!'0'},
					hintList : ['一星', '二星', '三星', '四星', '五星'],
					target:     '#hint_recommend',
				    targetKeep: true,
				    readOnly : true,
					click: function(score, evt) {
						$("#star_message").val(score);
					}
				});
			</script>
    		<div class="clear">
    	</div>
	    <div>
		   	<span class="red">好评率: </span></a>99%
		   	<a href="#comment_div_sign"><span class="red">${pager.getRecordCount()}条点评</span></a>
	    </div>
      	</div>
      </div>
      
      <div class="cart">
      	<span class="comment"><a href="#comment_input_div">我来推荐</a></span>
      	<span class="comment"><a href="#comment_input_div">发表评论</a></span>
      	<br />
      	<br />
      	<br />
      	<#include "/WEB-INF/template/mp/share_icon.ftl">
      </div>

      <div class="right_box">
        <div class="title">
        	<span class="title_icon">
        		<img src="${base}/mp/images/bullet4.gif" alt="" title="" />
        	</span>
        	去哪儿买？
        </div>
        <#if (brand.topLevelRecommendOnLineStore)??>
        <#list brand.topLevelRecommendOnLineStore as store>
        <div class="new_prod_box">
          <a target="_blank" href="${(store.pcUrl)!'#'}">${store.name}</a>
          <a target="_blank" href="${(store.pcUrl)!'#'}">
          <div class="new_prod_bg">
          	<span class="new_icon">
          		<img src="${base}/mp/images/promo_icon.png" alt="" title=""  />
          	</span>
            <img src="${(store.iconAbsolutePath)!'${base}/images/ppyeah.png'}" alt="" title="" class="thumb" width="100px" height="92px" border="0" onerror="javascript:nofind(this,'${base}/images/nopic.gif');" />
          </div>
          </a>
        </div>
        </#list>
        </#if>
        
      </div>
      <div class="right_box">
        <div class="title"><span class="title_icon"><img src="${base}/mp/images/bullet5.gif" alt="" title="" /></span>更多推荐</div>
        <ul class="list">
        <#if (brand.secondaryLevelRecommendOnLineStore)??>
		  <#list brand.secondaryLevelRecommendOnLineStore as store>
          	<li><a target="_blank" href="${(store.pcUrl)!''}">${(store.name)!''}</a></li>
		  </#list>
        </#if>
        </ul>
      </div>
    </div>
    <!--end of right content-->

    <div class="clear"></div>
    
  </div>
  
  <!-- 如果找不到店铺-终止 -->
  
  </#if>
  
  <!--end of center content-->

  <#include "/WEB-INF/template/mp/footer_bar.ftl">
</div>

<script type="text/javascript">

	var value=4;
													
	function showField(obj){
		$("#fields").show(200);
		value = obj===1?4:2;
		<#if fields??>
		<#list fields as field>
		$('#star_${field_index}').raty('start', value);
		grade[${field_index}].value=value;
		</#list>
		</#if>
	}
		
	function commentReset(obj){
		$("#fields").hide(200);
	}
	
	<#if fields??>
	var grade=[
	<#list fields as field>
		{'lable':'${field}','value':value},
	</#list>
	]
	</#if>
		
	<#if fields??>
	<#list fields as field>
	
	$('#star_${field_index}').raty({
		path : '${base}/mp/ratyimg/',
		start : value,
		hintList : ['很差', '不好', '凑合', '很好', '力挺'],
		target:     '#hint_${field_index}',
	    targetKeep: true,
		click: function(score, evt) {
			grade[${field_index}].value=score;
		}
	});
	</#list>
	</#if>
</script>

<script type="text/javascript" src="${base}/mp/js/comment_use.js"></script>

</body>
</html>
